<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app" style="background-color: aqua; margin-top: 200px; position: relative;">
        <div style="position: sticky; background-color: red; height: 200px; top: 200px; opacity: 0.2;"></div>
    </div>
   
    <script type="module">
        import {h} from "../demo/h.js";
        import p from "./p.js";
        import c from "./a.js"
        c();
        window.p=p;
        console.warn(c(),c(),p.uuid())
       const weakMap=new WeakMap();
       const remove=(target)=>{
         if(weakMap.has(target)){
            weakMap.delete(target);
            target.remove();
         }
       }
        for (let index = 0; index <5; index++) {
            let h1=h("h1",{
                onClick:(e)=>{
                    remove(e.target);
                }
            },p.uuid())
            weakMap.set(h1);
            app.append(h1)            
        }
        window.weakMap=weakMap;
    </script>
</body>
</html>